
export function validatorName(rule,value) {
  if(!value){
      return Promise.reject('请输入手机号')
  }else {
      let phoneReg = /^1[3456789]\d{9}$/
      if(phoneReg.test(value)){
          return Promise.resolve()
      }else{
          return Promise.reject('请输入正确的手机号')
      }
  }
}

export function validatorPassword(rule,value) {
  if(!value){
      return Promise.reject('请输入密码')
  }else{
      let passwordReg = /^(\w){6,12}$/
      if(passwordReg.test(value)){
          return Promise.resolve()
      }else{
          return Promise.reject('只能输入6~12位字符和下划线')
      }
  }
}
